global g_root "C:\Users\Hongye Guo\Dropbox (Personal)\Density\Code\Production\Submission"

use "$g_root\Data\worldscope_final", clear

drop if mi(fic)
drop if fic == "USA"
gen quarter = quarter(datadate)
gen month= month(datadate)

gen ym = mofd(rdq)
rename niq ibq

gen ct_rate = ceqq/ceqq_usd
gen ibq_usd = .
capture replace ibq_usd = ibq/fx_rate_is
replace ibq_usd = ibq/ct_rate if mi(ibq_usd)

replace ibq = ibq_usd
replace ceqq = ceqq_usd
drop if mi(ibq) | mi(ceqq) 

bysort fic: sum rpt_lag if rpt_lag <= 182, d

* Table C1
gen moy_rdq = month(rdq)
gen moy_datadate = month(datadate)

* Panel A 
gen moy_datadate_mod3 = mod(moy_datadate, 3)
tab moy_datadate_mod3 

* Panel B
gen moy_rdq_mod3 = mod(moy_rdq, 3)
tab moy_rdq_mod3 if rpt_lag <= 183 & mod(moy_datadate, 3)==0
tab moy_rdq_mod3 
